import { fileURLToPath } from 'node:url'
import { resolve } from 'node:path'

const baseUrl = fileURLToPath(new URL('.', import.meta.url))

// vite.config.ts 别名映射关系
export default [
  {
    find: '@',
    replacement: resolve(baseUrl, 'packages/hsm-ui/src'),
  },
  {
    find: /^@hsmos\/hsm-ui/,
    replacement: resolve(baseUrl, 'packages/hsm-ui/index.ts'),
  },
  {
    find: /^@hsmos\/utils/,
    replacement: resolve(baseUrl, 'packages/utils/index.ts'),
  },
  {
    find: /^@hsmos\/constants/,
    replacement: resolve(baseUrl, 'packages/constants/index.ts'),
  },
]
